<template>
  <div id="appfooter">
    <router-link :to="'/newsong/'+this.$route.params.id">
      <!-- <div >{{detail.name}}</div> -->
      
        <audio controls :src="songUrl" @click="play"></audio>
    </router-link>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name:'appfooter',
  data(){
    return{
      songUrl:"http://m701.music.126.net/20200424143358/428173dbd7eef9e1194c2e61e1873df1/jdymusic/obj/w5zDlMODwrDDiGjCn8Ky/2273645300/9397/716f/0bf8/323da71c284513ea72fe2650d877de7b.mp3"
    }
  },methods:{
    
    getdetail() {
      axios({
        method:'get',
        url:'http://localhost:5000/song/url?id'+this.$route.params.id
      }).then((res)=>{
       this.songUrl=res.data.data[0].url;
                console.log(res.data.data[0].url)
      }).catch((err)=>{
        console.log(err)
      });
      
    },
    play(){

    }
    },mounted(){
     this.getdetail();
     
    }
  }

</script>
